Show AllShow All

SUBTOTAL

See Also

Returns a subtotal in a list or database. It is generally easier to create a list with subtotals using the Subtotals command (Data menu). Once the subtotal list is created, you can modify it by editing the SUBTOTAL function.

Syntax

SUBTOTAL(function_num, ref1, ref2, ...)

Function_num    is the number 1 to 11 (includes hidden values) or 101 to 111 (ignores hidden values) that specifies which function to use in calculating subtotals within a list.

Function_num
(includes hidden values)
Function_num
(ignores hidden values)
Function
1 101 AVERAGE
2102 COUNT
3103 COUNTA
4104 MAX
5105 MIN
6106 PRODUCT
7107 STDEV
8108 STDEVP
9109 SUM
10110 VAR
11111 VARP

Ref1, ref2, are 1 to 29 ranges or references for which you want the subtotal.

Remarks

Example

The example may be easier to understand if you copy it to a blank worksheet.

Show How?

 
1
2
3
4
5
A
Data
120
10
150
23
Formula Description (Result)
=SUBTOTAL(9,A2:A5) Subtotal of the column above using the SUM function (303)
=SUBTOTAL(1,A2:A5) Subtotal of the column above using the AVERAGE function (75.75)